<script>
    $(document).ready(function(){
        Ext.get('parthistory-tab').on('click',function(){
            Ext.MessageBox.show({
                title:'Status',
                msg:'This feature is not available',
                buttons:Ext.MessageBox.OK
            });
        });
        Ext.get('flatrate-tab').on('click',function(){
            Ext.MessageBox.show({
                title:'Status',
                msg:'This feature is not available',
                buttons:Ext.MessageBox.OK
            });
            return false;
        });
    });
</script>
<?php

// Created by Khanh Nam
if($model->isNewRecord==false){
    $this->widget('zii.widgets.CMenu',array(
        'items'=>array(
            array('label'=>'General','url'=>array('Inventory/update','id'=>$model->partno)),
            array('label'=>'Manufacturer','url'=>array('Inventory/manufacturer','partno'=>$model->partno)),

            array('label'=>'Quan / Loc','url'=>array('/Inventoryquanity','partno'=>$model->partno),'active'=>Yii::app()->controller->id=='inventoryquanity'),
            array('label'=>'Notes','url'=>array('Inventory/notes','partno'=>$model->partno)),
            array('label'=>'Assembly','url'=>$model->parttype=='Assembly'?array('/Inventoryassembly','partno'=>$model->partno):'#','active'=>Yii::app()->controller->id=='inventoryassembly'),
            array('label'=>'QTY in Stock','url'=>array('/Inventoryact','partno'=>$model->partno),'active'=>Yii::app()->controller->id=='inventoryact'),
            array('label'=>'Alternate Parts','url'=>array('/vendorparts','partno'=>$model->partno),'active'=>Yii::app()->controller->id=='vendorparts'),
            array('label'=>'Flat Rate','url'=>'javascript:void(0)','linkOptions'=>array('id'=>'flatrate-tab')),
            array('label'=>'Part History','url'=>'javascript:void(0)','linkOptions'=>array('id'=>'parthistory-tab')),
        ),
        'id'=>'tab-menu',
        'htmlOptions'=>array(
            'class'=>'tabs tabs-with-summary',
        ),
    ));
}else{
    $this->widget('zii.widgets.CMenu',array(
        'items'=>array(
            array('label'=>'General','url'=>'#','active'=>Yii::app()->controller->id=='inventory'),
            array('label'=>'Manufacturer','url'=>'#'),

            array('label'=>'Quan / Loc','url'=>'#','active'=>Yii::app()->controller->id=='inventoryquanity'),
            array('label'=>'Notes','url'=>'#'),
            array('label'=>'Assembly','url'=>'#','active'=>Yii::app()->controller->id=='inventoryassembly'),
            array('label'=>'QTY in Stock','url'=>'#','active'=>Yii::app()->controller->id=='inventoryact'),
            array('label'=>'Alternate Parts','url'=>'#','active'=>Yii::app()->controller->id=='vendorparts'),
            array('label'=>'Flat Rate','url'=>'javascript:void(0)','linkOptions'=>array('id'=>'flatrate-tab')),
            array('label'=>'Part History','url'=>'javascript:void(0)','linkOptions'=>array('id'=>'parthistory-tab')),
        ),
        'id'=>'tab-menu',
        'htmlOptions'=>array(
            'class'=>'tabs tabs-with-summary',
        ),
    ));
}
?>
